package singleton;

public enum SingletonEnum {

    INSTANCE();

    private EnumSingleton uniqueInstance;

    SingletonEnum() {
        System.out.println("constructor of enum SingletonEnum");
        uniqueInstance = new EnumSingleton();
    }

    public EnumSingleton getInstance() {
        System.out.println("get the only instance of class EnumSingleton");
        return uniqueInstance;
    }

}

class EnumSingleton {
}
